/**
 * Created by wangle on 2018/4/17.
 */
qui(function (require, exports, module) {
    RecordCol.Config = $.extend({}, {}, {
        TABLE_COLMODEL_CONFIG: {
            id: {
                name: "id",
                index: 'id',
                title: false,
                width: 100,
                align: "center",
                sortable: false
            },
            colName: {
                name: "colName",
                index: 'colName',
                title: false,
                width: 120,
                align: "center",
                sortable: false
            },
            channelId: {
                name: "channelId",
                index: 'channelId',
                title: false,
                width: 120,
                align: "center",
                sortable: false,
                hidden:true
            },
            channelName: {
                name: "channelName",
                index: 'channelName',
                title: false,
                width: 120,
                align: "center",
                sortable: false,
            },
            hasAuth: {
                name: "hasAuth",
                index: 'hasAuth',
                title: false,
                width: 80,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                    return RecordCol.Util.formatter.hasAuth(v, o, r);
                }
            },
            hasPublic: {
                name: "hasPublic",
                index: 'hasPublic',
                title: false,
                width: 80,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                    return RecordCol.Util.formatter.hasPublic(v, o, r);
                }
            },
            categoryId: {
                name: "categoryId",
                index: 'categoryId',
                title: false,
                width: 120,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                    return RecordCol.Util.formatter.category(v, o, r);
                }
            },
            opUser: {
                name: "opUser",
                index: 'opUser',
                title: false,
                width: 180,
                align: "center",
                sortable: false
            },
            createTime: {
                name: "createTime",
                index: 'createTime',
                title: false,
                width: 300,
                align: "center",
                sortable: false
            },
            operator_plan_list: {
                title: false,
                width: 100,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                    return RecordCol.Util.formatter.operator_plan_list(v, o, r);
                }
            },
        },

        TABLE_COLMODEL_AUTH_CONFIG: {
            cprVideoName: {
                name: "cprVideoName",
                index: 'cprVideoName',
                title: false,
                width: 200,
                align: "center",
                sortable: false
            },
            videoType: {
                name: "videoType",
                index: 'videoType',
                title: false,
                width: 80,
                align: "center",
                sortable: false
            },
            productDate: {
                name: "productDate",
                index: 'productDate',
                title: false,
                width: 150,
                align: "center",
                sortable: false,
            },

            authStartDate: {
                name: "authStartDate",
                index: 'authStartDate',
                title: false,
                width: 150,
                align: "center",
                sortable: false,
                // formatter: function (v, o, r) {
                //     return RecordCol.Util.formatter.hasAuth(v, o, r);
                // }
            },
            authEndDate: {
                name: "authEndDate",
                index: 'authEndDate',
                title: false,
                width: 150,
                align: "center",
                sortable: false,
                // formatter: function (v, o, r) {
                //     return RecordCol.Util.formatter.hasPublic(v, o, r);
                // }
            },
            blackOrWhite: {
                name: "blackOrWhite",
                index: 'blackOrWhite',
                title: false,
                width: 100,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                     return RecordCol.Util.formatter.auth(v, o, r);
                }
            },
            updatedTime: {
                name: "updatedTime",
                index: 'updatedTime',
                title: false,
                width: 150,
                align: "center",
                sortable: false
            },
        },

        COL_DATA_LIST: {
            url: RecordCol.urlConfig.getColUrl,
            loadBeforeSend: function (xhr, settings) {
                var auth = Ancestor.Util.getAuth("/recordRPC/col/list");
                xhr.setRequestHeader('Sign', auth.sign);
                xhr.setRequestHeader("Time", auth.clientTime);
                xhr.setRequestHeader("From", auth.from);
                return true;
            },
            multiselect: false,
            loadtext: '加载中...',
            loadui: 'block',
            rowNum: 20,
            mtype: "post",
            datatype: "local",
            prmNames: {
                page: "pageNo",
                rows: "pageSize"
            },
            colNames: ["栏目ID", "栏目名称", "频道id","频道","素材", "有无版权", "创建人", "创建时间", "操作"],
            colModel: ['id', "colName", "channelId", "channelName","categoryId", "hasAuth","opUser", "createTime", "operator_plan_list"],
            pager: "#pager"
        },

        AUTH_DATA_LIST: {
            url: RecordCol.urlConfig.getColAuthUrl,
            loadBeforeSend: function (xhr, settings) {
                var auth = Ancestor.Util.getAuth("/recordRPC/col/authList");
                xhr.setRequestHeader('Sign', auth.sign);
                xhr.setRequestHeader("Time", auth.clientTime);
                xhr.setRequestHeader("From", auth.from);
                return true;
            },
            multiselect: false,
            loadtext: '加载中...',
            loadui: 'block',
            rowNum: 10,
            mtype: "post",
            datatype: "local",
            prmNames: {
                page: "currentPage",
            },
            colNames: ["版权片名",       "分类",       "发行时间",    "开始时间",        "截止时间",    "名单类型",      "最后更新"],
            colModel: ["cprVideoName", "videoType", "productDate","authStartDate", "authEndDate","blackOrWhite","updatedTime"],
            pager: "#pagerAuth",
            jsonReader:{
                root:"data",
                page: "currentPage",
                records: "totalRecords",
                repeatitems : false
            }
        },
        CODE_SUC: "A00000"
    });
});